Skip to content

[Feature] support prompt repetition_penalty #2806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

ming1753
Copy link
Collaborator

Support Prompt Repetition Penalty

Copy link

paddle-bot bot commented Jul 11, 2025

Thanks for your contribution!

@ming1753 ming1753 changed the title [BugFix] support prompt repetition_penalty [Feature] support prompt repetition_penalty Jul 15, 2025
Copy link
Collaborator

@qingqing01 qingqing01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要增加单测

}
}
if (i < prompt_len_now) {
int64_t id = prompt_ids[i];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里应该是prompt_now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes,我修复下

int times = repeat_times_now[i];
float logit_now = static_cast<float>(logits_now[i]);
if (times != 0) {
if (is_repeated[i] != 0) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用is_repeated判断和之前的区别是?

Copy link
Collaborator Author

@ming1753 ming1753 Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

if (i < prompt_len_now) {
int64_t id = prompt_ids[i];
if (id >= 0) {
atomicAdd(&is_repeated_now[id], 1);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

出现在prompt的token不用记入repeat_times吗,这块逻辑是否与模型组确认

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants